<!--
 * @Author: Zhouxin 2201_75539691@noreply.gitcode.com
 * @Date: 2024-11-20 23:02:30
 * @LastEditors: Zhouxin 2201_75539691@noreply.gitcode.com
 * @LastEditTime: 2024-11-21 00:33:33
 * @FilePath: \2024.11.20-day08-数组与字符串\1.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 一、看数组 观察变化找规律
初始 ['a','b','c','d','e'] 
第一次 ['d','e','a','b','c']
第二次 ['b','c','d','e','a']
第三次 ['e','a','b','c','d']
...
请问第五次 第十五次数组是如何? -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = ['a', 'b', 'c', 'd', 'e'];
        var arr2=[];
        for (var j = 1; j <= 15; j++) {

            for (var i = 0; i < arr.length; i++) {
                    arr2[(i + 2) % (arr.length)] = arr[i];
                }
                arr  = arr2;
                console.log("第",j+1,"次打印结果是：",arr2);
            }

 
    </script>
</body>

</html>